<script type="text/javascript"><!--//--><![CDATA[//><!--

 	$(document).ready(function() {
		// Setup Form
		$('#form_master').setupForm([
            { name: 'id_permintaan_dtl', type: 'text', size: 'medium', maxlength: 20, readonly:true},
			{ name: 'id_barangan', type: 'lov', size: 'short',
				onClearButton:function(){
					$(this).setval(''); 
					$('#nama_barang').setval(''); 
				},
				onActionButton:function(){ 
					LOVDataPerangkat({ onSelect:function(row){ 
						$('#id_barangan').setval(row.kode_barang); 
						$('#nama_barang').setval(row.nama_barang); 
					} }); 
				}
			},
            { name: 'nama_barang', type: 'text', size: 'medium', maxlength: 20, readonly:true },
			{ name: 'jumlah', type: 'text', size: 'medium', maxlength: 20, noempty:true },
			{ name: 'lokasi', type: 'text', size: 'long', maxlength: 200},
			{ name: 'keterangan', type: 'text', size: 'long', maxlength: 200}
		], <?php echo json_encode($data); ?>);
		
        <?php if($mode=="edit_detail"){ ?>
        $('#id_permintaan_dtl').readonly();
        <?php } ?>

        <?php if($mode=="create_detail"){ ?>
        $('#id_permintaan_dtl').setval('<?php echo $numb_id_detail; ?>');
        <?php } ?>
		
		var buttons = [{ label: 'Save', icon: 'save', onclick: function() { 
							$('#form_master').submitForm(	'/'+controller+'/ajax_post_detail/<?php echo $this->uri->segment(2); ?>/<?php echo $this->uri->segment(3); ?>' );
                            loadPage('/'+controller+'/edit/?id_permintaan=<?php echo $this->uri->segment(3); ?>'); }/*, onclick: function() { loadPage('/'+controller+'/Index');} */
						},
					   { label: 'Close', icon: 'cancel', onclick: function() { loadPage('/'+controller+'/edit/?id_permintaan=<?php echo $this->uri->segment(3); ?>'); } }];
		setAction(buttons);

		
    });




//--><!]]></script>

<div id="form_master_message" style="display:none;"></div>
    <table class="tb_form" style="display:none;" cellpadding="0" cellspacing="0">
    <tr>
        <td class="label" style="width:150px">ID Permintaan Perangkat Detail</td>
        <td colspan="2"><input id="id_permintaan_dtl" /></td>
    </tr>
    <tr>
        <td class="label" style="width:150px">Nama Barang</td>
        <td colspan="2"><input id="id_barangan" /><input id="nama_barang" name="nama_barang" /></td>
    </tr>
    <tr>
        <td class="label" style="width:150px">Jumlah</td>
        <td colspan="2"><input id="jumlah" /></td>
    </tr>
    <tr>
        <td class="label" style="width:150px">Lokasi</td>
        <td colspan="2"><input id="lokasi" /></td>
    </tr>
    <tr>
        <td class="label" style="width:150px">Keterangan</td>
        <td colspan="2"><input id="keterangan" /></td>
    </tr>
    </table>